<template>
    <div>
        <input type="text" v-model="mytext">
        <ul>
            <li v-for="(data, index) in computedList" :key="data">
                {{ data }}
            </li>
        </ul>
        <div v-if="computedList.length === 0">暂无搜索内容</div>
    </div>
</template>

<script>
import { reactive } from 'vue';
import useSearch from './hooks/search.js';

export default {
    setup() {

        const state = reactive({
            datalist: []
        })

        setTimeout(() => {
            console.log("111");
            state.datalist = ["aaa", "bbb", "ccc", "abc", "abb", "aab", "bcd", "add", "bbd"]
        }, 2000)


        return {
            ...useSearch(state)
        }
    }
}
</script>